Skip to content

Bump PyTorch pin to 2.13#20967

Open
JacobSzwejbka wants to merge 1 commit into
mainfrom
pytorch-2.13-pin-bump
Open

Bump PyTorch pin to 2.13#20967
JacobSzwejbka wants to merge 1 commit into
mainfrom
pytorch-2.13-pin-bump

Conversation

@JacobSzwejbka

@JacobSzwejbka JacobSzwejbka commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary
Bumps the ExecuTorch PyTorch pin to 2.13.0 and updates the matching torchvision/source branch pins to 0.28/release/0.28.

Also syncs c10 headers from PyTorch release/2.13, bumps third-party/ao to upstream commit 4aa810113, and pins source installs to torchao==0.18.0.dev20260715 from the PyTorch nightly wheel index. The torchao changes include pytorch/ao#4462 (Remove named tensor Dimname overload reference), needed for PyTorch 2.13 trunk quantization flows.

Pins torchtune installs to 3c1872ace149f03ef4ffec765d3f0a5fd0399497 from meta-pytorch/torchtune#2960 (Fix import error after torchao NF4Tensor move), because the latest stable PyPI release and the available PyTorch wheel-index torchtune versions still import torchao.dtypes.nf4tensor.

For Docker image builds, uses GCC/G++ for the PyTorch source build when the image default C++ compiler is Clang older than 16. PyTorch 2.13 rejects Clang 12 during configure, while the clang12 image should keep Clang 12 as its default compiler for ExecuTorch jobs.

Updates ExecuTorch's exportable NVFP4 quantization wrapper for the newer torchao API: when per-tensor scaling is disabled, pass None to torchao's nvfp4_quantize and serialize a scalar 1.0 tensor for ExecuTorch dequantization.

For Metal MPS torchao kernels, keeps the nightly torchao wheel as the default dependency but installs third-party/ao from the pinned submodule when TORCHAO_BUILD_EXPERIMENTAL_MPS=1 is set, so the Metal jobs get libtorchao_ops_mps_aten.dylib.

Adds the PyTorch 2.13 AOTI runtime aoti_torch_get_numel shim to ExecuTorch's common and SlimTensor AOTI shims, including coverage for the CUDA-Windows export path that links AOTInductor-generated wrappers. Regenerates the checked-in CUDA-Windows aoti_cuda_shims.lib import library so export-time wrapper links can resolve the new symbol.

Test Plan
python3 -m py_compile extension/llm/export/nvfp4.py install_requirements.py torch_pin.py
bash -n .ci/docker/common/install_pytorch.sh examples/models/llama/install_requirements.sh
c++ -std=c++17 -DC10_USING_CUSTOM_GENERATED_MACROS -I. -I.. -Iruntime/core/portable_type/c10 -c backends/aoti/common_shims_slim.cpp -o /tmp/common_shims_slim.o
c++ -std=c++17 -DC10_USING_CUSTOM_GENERATED_MACROS -I. -I.. -Iruntime/core/portable_type/c10 -c backends/aoti/common_shims.cpp -o /tmp/common_shims.o
nm -g backends/cuda/runtime/aoti_cuda_shims.lib | grep aoti_torch_get_numel
git diff --check
Verified torchao 0.18.0.dev20260715 exists in PyTorch nightly cpu/cu126/cu130/cu132 indexes.
Verified torchtune 0.6.1, 0.7.0+cpu, and 0.7.0.dev20250929+cpu still import torchao.dtypes.nf4tensor; torchtune commit 3c1872ace149f03ef4ffec765d3f0a5fd0399497 imports NF4Tensor from torchao.quantization.
.ci/scripts/compare_dirs.sh runtime/core/portable_type/c10/c10 /tmp/executorch-pytorch-c10-sync.hRGjXi/c10
.ci/scripts/compare_dirs.sh runtime/core/portable_type/c10/torch/headeronly /tmp/executorch-pytorch-c10-sync.hRGjXi/torch/headeronly

Note: could not run the failing XNNPACK export, Phi-4-mini aarch64 model job, MLX NVFP4 job, Metal model artifact export, CUDA-Windows export, or full Docker image build locally because this environment does not have torch/docker configured for those CI paths.

This PR was authored with Claude.

@pytorch-bot

pytorch-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20967

Note: Links to docs will display an error until the docs builds have been completed.

❌ 6 New Failures, 13 Pending, 1 Unrelated Failure, 3 Unclassified Failures

As of commit 727aee7 with merge base af62dce (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 15, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from 3d847d6 to b217a08 Compare July 15, 2026 17:26
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from b217a08 to 0174fd5 Compare July 15, 2026 17:32
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from 0174fd5 to 0b30cac Compare July 15, 2026 17:58
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from 0b30cac to 7e3efa5 Compare July 15, 2026 18:46
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from 7e3efa5 to 1a07e5d Compare July 15, 2026 18:56
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from 1a07e5d to d93a8a5 Compare July 15, 2026 19:31
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from d93a8a5 to a323b90 Compare July 15, 2026 20:29
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from a323b90 to 3fd187b Compare July 15, 2026 21:37
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from 60f74f8 to c61c28e Compare July 15, 2026 23:03
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from c61c28e to 59d0a6a Compare July 16, 2026 00:26
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from 59d0a6a to 179fb16 Compare July 16, 2026 01:20
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from 179fb16 to 53d99c2 Compare July 16, 2026 02:06
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from 53d99c2 to 791b688 Compare July 16, 2026 02:07
@JacobSzwejbka JacobSzwejbka force-pushed the pytorch-2.13-pin-bump branch from 791b688 to 91e7fb6 Compare July 16, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/cuda ciflow/mlx CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants